<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<#include "../head.html"/>
<script type="text/javascript">
var perms = [<#list cmsRole.perms as p>"${p}"<#if p_has_next>,</#if></#list>];
function disablePerms() {
	if($("input[name=super]:checked").val()=="true") {
		$(".perm-container input[type=checkbox]").attr("disabled","disabeld");
	} else {
		$(".perm-container input[type=checkbox]").removeAttr("disabled");
	}
}
$(function() {
	disablePerms();
	$("#jvForm").validate();
	$(".perm-container input[type=checkbox]").each(function() {
		var perm = $(this).val();
		var index = perm.indexOf(",");		
		if(index!=-1) {
			perm = perm.substring(0,index);
		}
		for(var i=0,len=perms.length;i<len;i++) {
			if(perms[i]==perm) {
				$(this).attr("checked",true);
				break;
			}
		}
	});
	$("input[name=super]").bind("click",function(){
		disablePerms();
	});
});
</script>
<style type="text/css">
.perm-container{}
.perm-layout-1{padding:3px 0;}
.perm-layout-2{padding-left:30px;}
</style>
</head>
<body>
<div class="box-positon">
	<div class="rpos">当前位置:  角色管理 - 修改</div>
	<form class="ropt">
		<input type="submit" value="返回列表" onclick="this.form.action='v_list.do';" class="return-button"/>
	</form>
	<div class="clear"></div>
</div>
<div class="body-box">
<form method="post" action="o_update.do" id="jvForm">
<table width="100%" class="pn-ftable" cellpadding="2" cellspacing="1" border="0">
<tr>
<td width="15%" class="pn-flabel pn-flabel-h"><span class="pn-frequired">*</span>角色名:</td>
<td colspan="1" width="35%" class="pn-fcontent">
<input type="text" maxlength="100" value="${cmsRole.name}" name="name" class="required" maxlength="100"/></td>
<td width="15%" class="pn-flabel pn-flabel-h">
<span class="pn-frequired">*</span>排列顺序:</td>
<td colspan="1" width="35%" class="pn-fcontent">
<input type="text" maxlength="5" value="10" name="priority" class="required digits" style="width:70px" maxlength="5"/></td></tr>
<tr><td width="15%" class="pn-flabel pn-flabel-h">拥有所有权限:</td>
<td colspan="3" width="85%" class="pn-fcontent">
<label><input type="radio" value="true" <#if cmsRole.super>checked="checked"</#if> name="super"/>是</label> 
<label><input type="radio" value="false" <#if !cmsRole.super>checked="checked"</#if>name="super"/>否</label>
</td>
</tr>
<tr><td width="15%" class="pn-flabel pn-flabel-h">功能权限:</td><td colspan="3" width="85%" class="pn-fcontent">
<#include "../role/perms.html"/>
</td></tr>
<tr><td colspan="4" class="pn-fbutton">
<input type="hidden" name="id" value="${cmsRole.id}"/>
<input type="submit" value="提交" class="submit" class="submit"/> &nbsp; <input type="reset" value="重置" class="reset" class="reset"/></td>
</tr></table>
</form>
</div>
</body>
</html>